package com.kreao.korean.service.interfaces;

import com.kreao.korean.dto.WordRequest;
import com.kreao.korean.dto.WordResponse;
import com.kreao.korean.entity.Word;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * 单词服务接口
 */
public interface WordService {
    
    /**
     * 创建单词
     */
    WordResponse createWord(WordRequest request, Long userId);
    
    /**
     * 更新单词
     */
    WordResponse updateWord(Long wordId, WordRequest request, Long userId);
    
    /**
     * 删除单词
     */
    void deleteWord(Long wordId, Long userId);
    
    /**
     * 获取单词详情
     */
    WordResponse getWord(Long wordId, Long userId);
    
    /**
     * 获取用户单词列表
     */
    Page<WordResponse> getUserWords(Long userId, Pageable pageable);
    
    /**
     * 搜索单词
     */
    Page<WordResponse> searchWords(Long userId, String keyword, Pageable pageable);
    
    /**
     * 按分类获取单词
     */
    Page<WordResponse> getWordsByCategory(Long userId, Word.WordCategory category, Pageable pageable);
    
    /**
     * 获取收藏的单词
     */
    Page<WordResponse> getFavoriteWords(Long userId, Pageable pageable);
    
    /**
     * 获取需要复习的单词
     */
    List<WordResponse> getWordsForReview(Long userId);
    
    /**
     * 获取需要重点复习的单词
     */
    List<WordResponse> getWordsNeedReview(Long userId, Double accuracy);
    
    /**
     * 切换收藏状态
     */
    WordResponse toggleFavorite(Long wordId, Long userId);
    
    /**
     * 批量导入单词
     */
    List<WordResponse> importWords(List<WordRequest> wordRequests, Long userId);
    
    /**
     * 获取用户单词统计
     */
    WordStatistics getWordStatistics(Long userId);
    
    /**
     * 单词统计信息
     */
    record WordStatistics(
        Long totalWords,
        Long favoriteWords,
        Long reviewWords,
        Long todayStudyWords
    ) {}
} 